

#pragma once
#include "resource.h"

#define WM_INVITE_VIDEO		WM_USER+1001
#define WM_INVITE_AUIDO		WM_USER+1002
#define WM_INVITE_FILE		WM_USER+1003
class CShowDlg : public CAxDialogImpl<CShowDlg>,public CUpdateUI<CShowDlg>,public CMessageFilter,public CIdleHandler
{
public:
	enum { IDD = IDD_DIALOG_SHOW };
	CRichEditCtrl		m_show_ctl;
	CHARFORMAT			m_syscf1;
	CHARFORMAT			m_syscf2;
	CHARFORMAT			m_syscf3;
	virtual BOOL PreTranslateMessage(MSG *pMSG)
	{
		if(m_hWnd)
			return CWindow::IsDialogMessage(pMSG);
		return false;
	}
	virtual BOOL OnIdle()
	{
		return false;
	}
	BEGIN_UPDATE_UI_MAP(CShowDlg)
	END_UPDATE_UI_MAP()

	BEGIN_MSG_MAP(CShowDlg)
		MESSAGE_HANDLER(WM_SIZE, OnSize)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(IDC_BUTTON_VIDEO, OnVideo)
		COMMAND_ID_HANDLER(IDC_BUTTON_AUDIO, OnAudio)
		COMMAND_ID_HANDLER(IDC_BUTTON_FILE, OnFile)
		CHAIN_MSG_MAP(CUpdateUI<CShowDlg>)
	END_MSG_MAP()
	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
	void ShowMsg(wstring usr,wstring time,wstring msg,bool bself,CHARFORMAT cf,bool system = false);
	LRESULT OnVideo(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnAudio(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnFile(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	void  EnableVideo(bool Enable);
	void  EnableAudio(bool Enable);
};